<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul>
        <li>我是1</li>
        <li>我是2</li>
        <li>我是3</li>
        <li>我是4</li>
        <li>我是5</li>
        <li>我是6</li>
        <li>我是7</li>
        <li>我是8</li>
        <li>我是9</li>
        <li>我是10</li>
    </ul>
    <script>
        var oLi=document.getElementsByTagName("li");
        for(var i=0;i<oLi.length;i++){
            oLi[i].style.listStyle="none";
            oLi[i].style.backgroundColor=i%2==0?"yellow":"skyblue";
        }
    </script>
</body>
</html>